import pandas as pd
import numpy as np

t =pd.DataFrame(np.arange(12).reshape((3,4)),index=list("XYZ"),columns=list("abcd"))
print(t)

# d1 = {"name":["tom","jack"],"age":[18,20],"address":[10010,10029]}
# t2 = pd.DataFrame(d1)
# print(t2)

#取行
print(t.loc["X"])
#取列
print(t.loc[:,"a"])

#取行
print(t.iloc[1])
#取列
print(t.iloc[:,2])


